//package com.envper.common.util;
//
//import com.envper.mysql.domain.Status;
//import com.envper.common.exception.GlobalException;
//import lombok.extern.slf4j.Slf4j;
//import org.eclipse.paho.mqttv5.client.MqttClient;
//import org.eclipse.paho.mqttv5.common.MqttException;
//
//@Slf4j
//public class MqttUtils {
//    private static MqttClient mqttClient = null;
//
//    public static void setMqttClient(MqttClient mqttClient) {
//        MqttUtils.mqttClient = mqttClient;
//    }
//
//    public static void sendMessage(String topic, String message) {
//        if (mqttClient != null) {
//            try {
//                mqttClient.publish(topic, message.getBytes(), 1, false);
//            } catch (MqttException e) {
//                log.error(e.getMessage(), e);
//                throw new GlobalException(Status.SENDMESSAGEERROR);
//            }
//        }
//    }
//
//
//}
